package labox.innovation.loginserver.socket.serverpackets;

/**
 * 更新客户端资源
 * 
 */
public final class ResouceUpdate extends LoginServerPacket {

	public static final int SVN_NEWVERSION = -1;

	public static final int SVN_UPDATANIMATIONEMODEL = 0;

	public static final int SVN_UPDATEANIMATIONIMAGE = 1;

	public static final int SVN_UPDATEMAPIMAGE = 2;

	private int _curType;

	private int _resIndex;

	private byte[] _data;

	public ResouceUpdate(int curType, int resIndex, byte[] data) {
		_curType = curType;
		_resIndex = resIndex;
		_data = data;
	}

	/**
	 * @see com.l2jserver.mmocore.network.SendablePacket#write()
	 */
	@Override
	public void write() {
		writeByte(PTL_RESOUCEUPDATE);
		writeByte(_curType);
		writeByte(_resIndex);
		if (_data != null)
			writeData(_data);
	}
}
